package com.liuzh.deviceinfo.analyzer.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import c.h.a.w.k.h;
import c.h.a.w.k.i;

public abstract class BaseFloatingDetailView extends LinearLayout implements OnClickListener {
    public h a;
    public b b;
    public ImageView c;
    public int d;

    public interface b {
        void onClickClose();
    }

    public class a implements b {
        public a(BaseFloatingDetailView baseFloatingDetailView) {
        }

        public void onClickClose() {
        }
    }

    public BaseFloatingDetailView(Context context) {
        super(context);
        LinearLayout.inflate(getContext(), getLayoutId(), this);
        View findViewById = findViewById(2131296345);
        findViewById.setClickable(false);
        findViewById.setFocusable(false);
        findViewById.setEnabled(false);
        setBackgroundColor(c.f.a.a.a.a.n(getContext(), 16842801));
        setOrientation(1);
        setClickable(true);
        ImageView imageView = (ImageView) findViewById(2131297274);
        this.c = imageView;
        imageView.setVisibility(0);
        this.c.setImageResource(2131230990);
        this.c.setBackground(c.f.a.a.a.a.o(getContext(), 16843676));
        this.c.setOnClickListener(this);
        findViewById(2131296727).setVisibility(8);
        findViewById(2131296651).setVisibility(8);
        b();
    }

    public abstract void a();

    public abstract void b();

    public void c() {
        View findViewById = findViewById(2131296345);
        ((TextView) findViewById.findViewById(2131297287)).setText(((i) this.a.c.get(this.d)).c);
        ((TextView) findViewById.findViewById(2131297291)).setText(((i) this.a.c.get(this.d)).a);
        ((TextView) findViewById.findViewById(2131297284)).setText(((i) this.a.c.get(this.d)).b.a());
    }

    public b getCloseListener() {
        b bVar = this.b;
        return bVar == null ? new a(this) : bVar;
    }

    public abstract int getLayoutId();

    public void onClick(View view) {
        if (view.getId() == 2131297274) {
            b bVar = this.b;
            if (bVar != null) {
                bVar.onClickClose();
            }
        }
    }

    public void setCloseListener(b bVar) {
        this.b = bVar;
    }

    public BaseFloatingDetailView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        LinearLayout.inflate(getContext(), getLayoutId(), this);
        View findViewById = findViewById(2131296345);
        findViewById.setClickable(false);
        findViewById.setFocusable(false);
        findViewById.setEnabled(false);
        setBackgroundColor(c.f.a.a.a.a.n(getContext(), 16842801));
        setOrientation(1);
        setClickable(true);
        ImageView imageView = (ImageView) findViewById(2131297274);
        this.c = imageView;
        imageView.setVisibility(0);
        this.c.setImageResource(2131230990);
        this.c.setBackground(c.f.a.a.a.a.o(getContext(), 16843676));
        this.c.setOnClickListener(this);
        findViewById(2131296727).setVisibility(8);
        findViewById(2131296651).setVisibility(8);
        b();
    }
}
